<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  用户名： <input type="text" id="username">
  <br>
  密码: <input type="text" id="password">
  <br>
  <button id="reg">注册</button>
  <!-- 引入封装好的 操作cookie的插件 -->
  <script src="./tool/utils.js"></script>
  <script>
    // 注册 把用户名 密码 放到cookie中存起来
    var reg = document.getElementById("reg");
    reg.onclick = function () {
      var usernameval = document.getElementById("username").value; // 用户名
      var passwordval = document.getElementById("password").value; //密码
      setCookie("user", usernameval, 80)
      setCookie("password", passwordval, 80)
      alert("注册成功跳转登录")
      location.href = "./10 login.html"
    }
  </script>
</body>

</html>